[HVM] Save/restore: update HVM detection in save/restore code in xend.
authorTim Deegan <Tim.Deegan@xensource.com>
Mon, 12 Mar 2007 18:04:04 +0000 (18:04 +0000)
committerTim Deegan <Tim.Deegan@xensource.com>
Mon, 12 Mar 2007 18:04:04 +0000 (18:04 +0000)
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
tools/python/xen/xend/XendCheckpoint.py

index 92ba37d4fd595a51881e59e9442c9fef14e23982..ba9ee645c769db0e57b1524d00f91da6e4d04514 100644 (file)
@@ -73,13 +73,14 @@ def save(fd, dominfo, network, live, dst, checkpoint=False):
         write_exact(fd, config, "could not write guest state file: config")
 
         image_cfg = dominfo.info.get('image', {})
-        hvm = image_cfg.has_key('hvm')
+        hvm = dominfo.info.is_hvm()
         stdvga = 0
 
         if hvm:
             log.info("save hvm domain")
-            if image_cfg['hvm']['devices']['stdvga'] == 1:
-                stdvga = 1
+            if dominfo.info['platform'].has_key('stdvga'):
+                if dominfo.info['platform']['stdvga'] == 1:
+                    stdvga = 1
 
         # xc_save takes three customization parameters: maxit, max_f, and
         # flags the last controls whether or not save is 'live', while the
@@ -188,7 +189,7 @@ def restore(xd, fd, dominfo = None, paused = False):
 
     # if hvm, pass mem size to calculate the store_mfn
     image_cfg = dominfo.info.get('image', {})
-    is_hvm  = image_cfg.has_key('hvm')
+    is_hvm = dominfo.info.is_hvm()
     if is_hvm:
         hvm  = dominfo.info['memory_static_min']
         apic = dominfo.info['image']['hvm'].get('apic', 0)